<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
		<meta name="viewport" content="width=device-width,initial-scale=1">
		<title>我的伙伴</title>
		<link rel="stylesheet" th:href="@{/css/jquery.mobile-1.4.5.min.css }"/>
		<script th:src="@{/js/jquery.min.js}"></script>
		<script th:src="@{/js/jquery.mobile-1.4.5.min.js}"></script>
		<link rel="stylesheet" th:href="@{/css/iconfont.css}"/>
		<script>
			$(document).ready(function(){
				window.sessionStorage.removeItem("zhanshiid");
				var user=JSON.parse(sessionStorage.getItem("user"));
				var userid=user.userid;
				// $.ajax({
				// 		url: "http://localhost:8080/UserController/getPartnersNoMe",
				// 	    type: "POST",
				// 		data : {"userid" : userid},
				// 	    dataType: "json",
				// 	    success : function(data) {
				// 			var oData = eval(data);
				// 			var markup ='';
				// 			$.each(oData,function(i){
				// 				markup += '<li><a onclick="goZhanShi('+oData[i].userid+')"><div class="ui-grid-a"><div class="ui-block-a">';
				// 				markup += '<img  src="'+oData[i].userhead+'" width="100%" style="border-radius:100%;"/>';
				// 				markup += '</div><div class="ui-block-b">';
				// 				markup += '<h1 style="font-size: 25px;">'+oData[i].name+'</h1>';
				// 				markup += '</div></div></a></li>';
				// 				});
				// 				$("#lv1").html(markup);
				// 				$("#lv1").trigger("create").listview("refresh");
				// 			},error : function(data, status) {
				// 			console.log("后台异常");
				// 		}
				// 	});
				});
			function goMy(){
				var user=JSON.parse(sessionStorage.getItem("user"));
				if(user==null||user==""){
					$("#pleaseLogin").popup('open');
				}else{
					window.location = "/ViewController/toMy";
				}
			}
			function goZhanShi(zhanshiid){
				console.log(zhanshiid);
				sessionStorage.setItem("zhanshiid",zhanshiid);
				window.location = "/MyController/getPartnerPage?userid="+zhanshiid;
				}
			
		</script>
		<style>
			#lv1 .ui-block-a{
				width: 15%;
			}
			#lv1 .ui-block-b{
				width: 85%;
			}
		</style>
		<style type="text/css">
			.ui-icon-guiji:after{
			  background:url('/image/guiji.png') no-repeat 0px 0px;
			}
			.ui-icon-partners:after{
			  background:url(/image/paetners.png) no-repeat 0px 0px;
			}
			.ui-icon-my:after{
			  background:url(/image/my.png) no-repeat 0px 0px;
			}
			.ui-icon-zhanghao:after{
			  background:url(/image/zhanghao.png) no-repeat 0px 0px;
			}
			.ui-icon-about:after{
			  background:url(/image/about.png) no-repeat 0px 0px;
			}
		</style>
	</head>
	<body>
		<div data-role = "page">
			<div data-role = "header"  data-fullscreen = "true">
				<a  href="/ViewController/goUserPanel2" data-icon = "zhanghao" data-ajax = "false"  >账号</a>
				<h1>我的伙伴</h1>
				<a href="/ViewController/goAbout" data-icon = "about" data-ajax = "false">关于</a>
			</div>
			<div data-role = "content">
				<h3>请选择用户</h3>
				<ul data-role = "listview" id="lv1">
					<!-- <li>
					<div class="ui-grid-a">
						<div class="ui-block-a">
								<img  src="image/logo.png" width="100%"/>
						</div>
						<div class="ui-block-b">
								<h1 style="font-size: 25px;">111展示的人生</h1>
								
						</div>
					</div>
					</li> -->
					<div th:each="User,stat:${ListNoMe}">
						<a style='color: #000000; text-decoration:none;' data-ajax='false' th:onclick="'javascript: goZhanShi('+${User.userid}+')' ">
							<li style='margin-bottom:5px;background-color:#ffffff;'>
								<div class="ui-grid-a">
									<div class="ui-block-a">
										<img  th:src='${User.userhead}' width="100%" style="border-radius:100%;"/>
									</div>
									<div class="ui-block-b">
										<h1 style="font-size: 25px;" th:text="${User.name}"></h1>
									</div>
								</div>
							</li>
						</a>
					</div>
				</ul>
			</div>
			<div data-role = "footer" data-position = "fixed" data-tap-toggle="false">
				<div data-role = "navbar" data-grid = "b">
					<ul>
						<li><a href="/ExperiecneCotroller/getAllExperience" data-icon = "guiji" data-ajax = "false">成长轨迹</a></li>
						<li><a data-icon = "partners" data-ajax = "false" class="ui-btn-active ui-state-persist">伙伴</a></li>
						<li><a onclick="goMy()" data-icon = "my" data-ajax = "false">我的</a></li>
					</ul>
				</div>
			</div>
		</div>
	</body>
</html>
